package com.gao.e_callable.a;

import java.util.Random;

/**
 * @author gaopeng
 * @time 2021/03/18 17:43:19
 * 需求，子线程中，所产生的数据，或者得到的数据，想要交给主线程
 */

class T implements Runnable {

    @Override
    public void run() {
        int n = new Random().nextInt(10);
        // How to pass the n to main thread!!!
        System.out.println("子线程：" + n);
    }
}

public class App {
    public static void main(String[] args) {
        new Thread(new T()).start();
    }
}
